Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document run state and result #2556

Merged
merged 3 commits into from
Nov 16, 2023
Merged

Document run state and result #2556

merged 3 commits into from
Nov 16, 2023

Conversation

sj26
Copy link
Member

@sj26 sj26 commented Nov 15, 2023

Add brief docs for the properties introduced in https://github.com/buildkite/buildkite/pull/14616.

@buildkite-docs-bot
Copy link
Contributor

Preview URL: https://2556--bk-docs-preview.netlify.app

pages/apis/rest_api/analytics/runs.md Outdated Show resolved Hide resolved
@@ -45,3 +49,7 @@ curl "https://api.buildkite.com/v2/analytics/organizations/{org.slug}/suites/{su
Required scope: `read_suites`

Success response: `200 OK`

Runs are created with a `state` of `running` and proceed to `finished` when all uploads have been processed. The run may return to `running` if additional results are uploaded.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Runs are created with a `state` of `running` and proceed to `finished` when all uploads have been processed. The run may return to `running` if additional results are uploaded.
Runs are created with a `state` of `running` and proceed to `finished` when all uploads have been processed. The run may return to `running` if additional results are uploaded. If a run receives no results within a reasonable time period its `state` will proceed to `stale`.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI our default scope on runs excludes runs that are stale, so I think the behaviour might be that the API will returning the running run if requested, but once the run becomes stale the same API request will probably return a not found or similar?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would happen now with the API as well so I'm not suggesting a change in behaviour, I was just wondering maybe if we shouldn't mention the stale state at all because it wouldn't ever be returned to the customer in the API

Copy link
Member Author

@sj26 sj26 Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this addition here is correct. result can become stale, but state can only be running or finished.

https://github.com/buildkite/buildkite/blob/59f40cc5f38003926cb6a91945a923ac12af4860/app/models/analytics/run.rb#L13-L23

I've re-added the words to the state paragraph.

But point taken about the default scopes. The docs are pretty light here, so I think a general note about the expected values and transitions is enough.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I totally thought stale was a state and not a result, but yeah that's not what the code says!

@sj26 sj26 merged commit 47ec4a8 into main Nov 16, 2023
1 check passed
@sj26 sj26 deleted the add-analytics-run-state-result branch November 16, 2023 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants